<%@ page contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*" errorPage="" %>
<%@ include file="../Connections/A146240Connection.jsp" %>
<%

String Prepared1__theID = null;
if(session.getAttribute("prodID") != null){ Prepared1__theID = (String)session.getAttribute("prodID");}

String Prepared1__amount = null;
if(session.getValue("prodAmount") != null){ Prepared1__amount = (String)session.getValue("prodAmount");}

%>
<%
Driver DriverPrepared1 = (Driver)Class.forName(MM_A146240Connection_DRIVER).newInstance();
Connection ConnPrepared1 = DriverManager.getConnection(MM_A146240Connection_STRING,MM_A146240Connection_USERNAME,MM_A146240Connection_PASSWORD);
PreparedStatement Prepared1 = ConnPrepared1.prepareStatement("UPDATE A152786.PRODUCT  SET PRODUCT_QUANTITY = PRODUCT_QUANTITY - '"+ Prepared1__amount + "' WHERE PRODUCT_ID = '"+ Prepared1__theID + "'");
Prepared1.executeUpdate();
ConnPrepared1.close();
response.sendRedirect("../Product/");
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
</head>

<body>
<%=session.getAttribute("prodID")%>
</body>
</html>

